package com.dc.designPattern._16_observer.impl;

/**
 * Description: 观察者模式_具体观察者_百度网站
 * @author: gdc
 * @date: 2021/5/20
 * @version 1.0
 */
public class BaiduSite implements Observer {

    /**
     * 温度
     */
    private double temperature;
    /**
     * 压力
     */
    private double pressure;
    /**
     * 湿度
     */
    private double humidity;

    @Override
    public void update(double temperature, double pressure, double humidity) {
        this.temperature = temperature;
        this.pressure = pressure;
        this.humidity = humidity;

        display();
    }

    /**
     * 显示
     */
    private void display() {
        System.out.println("===百度网站===");

        System.out.println("***百度网站 气温: " + temperature + "***");
        System.out.println("***百度网站 气压: " + pressure + "***");
        System.out.println("***百度网站 湿度: " + humidity + "***");
    }
}
